{include file="header"}
<div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body" style="padding: 15px;">
	      <!-- 添加自定义配置 -->
        {if get('or',0) == '0'}
		    <form class="layui-form" url="{:url('admin/api/add')}" t_url="javascript:parent.location.reload();">
        {else /}
        <form class="layui-form" url="{:url('admin/api/edit')}" t_url="javascript:parent.location.reload();">
        <input type="hidden" name="id" value="{$c.id}">
        {/if}
        <input type="hidden" name="model" value="set_config">
        <input type="hidden" name="tid" value="{:get('id')}">
          <div class="layui-form-item">
              <select name="type" lay-verify="required">
                <option value="">请选择类型</option>
                <option value="1" {if $c.type == 1}selected="选择"{/if}>输入框</option>
                <option value="2" {if $c.type == 2}selected="选择"{/if}>文本域</option>
                <option value="3" {if $c.type == 3}selected="选择"{/if}>附件上传</option>
                <option value="4" {if $c.type == 4}selected="选择"{/if}>选择框</option>
                <option value="5" {if $c.type == 5}selected="选择"{/if}>描述</option>
              </select>
          </div>
          <div class="layui-form-item">
              <input type="text" name="name" lay-verify="required" value="{$c.name}" autocomplete="off" placeholder="例如什么配置" class="layui-input">
          </div>
          <div class="layui-form-item">
              <input type="number" name="px" lay-verify="required" value="{$c.px|default="1"}" autocomplete="off" placeholder="排序 越大越靠前" class="layui-input">
          </div>
          <div class="layui-form-item">
              <input type="text" name="var" lay-verify="required"  value="{$c.var}" autocomplete="off" placeholder="英文变量 例如set" class="layui-input">
          </div>
          <div class="layui-form-item">
              <input type="number" name="high" lay-verify="required" value="{$c.high|default="100"}" autocomplete="off" placeholder="文本域高度" class="layui-input">
          </div>
          <div class="layui-form-item layui-layout-admin">
            <div class="layui-input-block">
              <div class="layui-footer" style="left: 0;">
                <button class="layui-btn" lay-submit="" lay-filter="cms">立即提交</button>
                {if get('or',0) != '0'}
                <a class="layui-btn layui-btn-danger del_t" t_url="javascript:parent.location.reload();" url="{:url('admin/api/catedelete')}?model=set_config&id={$c.id}" name="确定要删除这条变量吗？请谨慎">删除</a>
                {/if}
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
  {include file="footer"}